<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li{
            list-style: none;
        }
        img{
            width: 100px;
            height: 100px;
            background-size: 100%;
        }
        .bd{
            width: 480px;
            display: flex;
            height: 100px;
            justify-content: space-between;
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <ul class="bd">
        <li><img src="./bjt1.jpg"></li>
        <li><img src="./bjt2.jpg"></li>
        <li><img src="./bjt3.jpg"></li>
        <li><img src="./bjt4.jpg"></li>
    </ul>
    <script>
        let img = document.querySelectorAll('img');
        console.log(img);
        for(var i =0; i< img.length;i++){
            document.body.style.backgroundImage =  'url(bjt1.jpg)'
            img[i].onclick = function(){
                document.body.style.backgroundImage =  'url('+ this.src +')'
            }
        }
    </script>
</body>
</html>